package cn.com.bluemoon.daps.system.mapper;

import cn.com.bluemoon.daps.system.entity.DapSystemBizLineDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 系统与业务线关系信息表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2022-04-06
 */
public interface DapSystemBizLineDetailMapper extends BaseMapper<DapSystemBizLineDetail> {

    @Select("select * from dap_system_biz_line_detail where bm_status =1 and ( find_in_set(#{userId} , admins) )")
    List<DapSystemBizLineDetail> findByAdminUserId(@Param("userId") String userId);

    @Select("select * from dap_system_biz_line_detail where bm_status =1 and ( find_in_set(#{userId} , admins) or find_in_set(#{userId} , develops) )")
    List<DapSystemBizLineDetail> findByAdminOrDevelopUserId(@Param("userId") String userId);
}
